package com.example.yuanann.vegetable_app.fragment;

import android.graphics.Color;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;

import com.example.yuanann.vegetable_app.R;

public class Chat extends Fragment {

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_home_chat, container, false);
        return view;
    }


    public void onActivityCreated(Bundle savedInstanceState) {

        super.onActivityCreated(savedInstanceState);
        super.onCreate(savedInstanceState);

        Fragment c1 = new Chat_list();
        //实例化管理器
        FragmentManager fragmentManager = getFragmentManager();
        //定义事务
        FragmentTransaction fta = fragmentManager.beginTransaction();
        //添加fragment
        fta.add(R.id.userListShowView, c1);
        //提交事务`
        fta.commit();

    }
}

